package day19;

public class SaleTicketThread {
    public static void main(String[] args) throws InterruptedException {
        SaleTicket saleTicket = new SaleTicket();
        Thread thread1 = new Thread(saleTicket,"第一个窗口");
        Thread thread2 = new Thread(saleTicket,"第二个窗口");
        Thread thread3 = new Thread(saleTicket,"第三个窗口");
        Thread thread4 = new Thread(saleTicket,"第四个窗口");

        thread1.start();
        thread2.start();
        thread3.start();
        thread4.start();

        thread1.join();
        thread2.join();
        thread3.join();
        thread4.join();

        System.out.println("还剩"+SaleTicket.getTicket()+"张票");

    }
}
